<?php
require_once 'modules/dao/commonDao.php';

class LinksDao extends CommonDao {
    /**
     * 链接DAO
     * @author liuhui 2009-6-15
     */
    protected $table_name = Consts::T_LINKS;
    protected $primary_key = Consts::F_ID;

    public function gets ($catId, $offset = 0, $limit = 10) {
        $catId = $this->checkInt($catId);
        if ($catId < 1) {
            return null;
        }
        $where = array(Consts::F_CID => $catId);
        return $this->__gets($where, $offset, $limit);
    }

    public function count ($catId) {
        $catId = $this->checkInt($catId);
        if ($catId < 1) {
            return null;
        }
        $where = array(Consts::F_CID => $catId);
        return $this->__count($where);
    }
}
?>